package com.nebulas;

import com.nebulas.nettyhex.server.RuoYiNettyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.Async;

@SpringBootApplication
public class NettyHexApplication extends SpringBootServletInitializer implements CommandLineRunner {



    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
    {
        return application.sources(NettyHexApplication.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(NettyHexApplication.class, args);
        System.out.println(" ruoyi-nettyﾞ  系统启动成功   永不宕机，永无bugﾞ");

    }


    @Async
    @Override
    public void run(String... args) throws Exception {
        //**
        // * 使用异步注解方式启动netty服务端服务
        //*
        new RuoYiNettyServer().bind(19183);
    }
}
